'use client';
import {usePathname, useSearchParams} from "next/navigation";

export default function ReadPage() {
    const path = usePathname();
    const params = useSearchParams();
    // console.log(path, params)
    const name = params.get('name');
    console.log(name)

    return (
        <div className={'w-full h-screen'}>
            <object data={`/book/${name}`} type="application/pdf" className={'w-full h-full'}>
                <iframe src={`/book/${name}`} width="100%" height="100%">
                    This browser does not support PDFs. Please download the PDF to view it:
                    <a href={`/book/${name}`}>Download
                        PDF</a>
                </iframe>
            </object>
        </div>
    )
}